﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using l1cs.server.model.Instance;
using l1cs.server.model;

namespace l1cs.server.clientpackets
{
    public class C_EnterPortal : ClientBasePacket
    {
        private const String _C_ENTER_PORTAL = "[C] C_EnterPortal";
        private static Logger _log = Logger.getLogger( typeof( C_EnterPortal ).FullName );

        public C_EnterPortal( byte[] abyte0, ClientThread client )
            : base( abyte0 )
        {
            int locx = readH();
            int locy = readH();
            L1PcInstance pc = client.getActiveChar();
            if ( pc.isTeleport() )
            { // テレポート処理中
                return;
            }
            // ダンジョンにテレポート
            Dungeon.getInstance().dg( locx, locy, pc.getMap().getId(), pc );
        }

        override
        public String getType()
        {
            return _C_ENTER_PORTAL;
        }
    }
}